<template>
  <div class="hot-services" style="width: 500px; height: 280px;">
    <!-- 标题区域 -->
    <div class="title-bar">
      <span class="title-text">当前热门服务事项TOP5</span>
      <div class="title-line"></div>
    </div>

    <!-- 列表区域 -->
    <div class="list-container">
      <div v-for="(item, index) in items" :key="index" class="item">
        <div class="rank-icon">
          <span class="rank-number">{{ item.rank }}</span>
        </div>
        <div class="service-name">{{ item.name }}</div>
        <div class="progress-bar">
          <div class="progress-fill" :style="{ width: item.percent + '%' }"></div>
        </div>
        <div class="percent">{{ item.percent }}%</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Shixiang',
  setup() {
    const items = [
      { rank: '1', name: '服务事项一', percent: 92 },
      { rank: '2', name: '服务事项二', percent: 79 },
      { rank: '3', name: '服务事项三', percent: 70 },
      { rank: '4', name: '服务事项四', percent: 65 },
      { rank: '5', name: '服务事项五', percent: 55 }
    ];

    return {
      items
    };
  }
};
</script>

<style scoped>
.hot-services {
  width: 500px;
  height: 280px;
  background-color: #0f2035;
  border-radius: 8px;
  overflow: hidden;
  padding: 20px;
  box-sizing: border-box;
}

.title-bar {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.title-text {
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
}

.title-line {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, #00baff, #00e4ff);
  border-radius: 2px;
}

.list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rank-icon {
  width: 24px;
  height: 24px;
  background-color: #1a3c5d;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
}

.service-name {
  color: #fff;
  font-size: 14px;
  flex: 1;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffaa00, #00baff);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.percent {
  color: #fff;
  font-size: 12px;
  margin-left: 10px;
}
</style>